<?php

namespace common\model;

use think\model\RelationModel;

class TaskExecutorRecordModel extends RelationModel
{
    //自动验证
    protected $_validate = [
        ['task_id', '', '', self::MUST_VALIDATE, 'require', self::MODEL_INSERT], // 任务id
        ['task_id', '', '', self::EXISTS_VALIDATE, 'integer'], // 任务id

        ['user_id', '', '', self::MUST_VALIDATE, 'require', self::MODEL_INSERT],// 必须字段
        ['user_id', '', '', self::EXISTS_VALIDATE, 'integer'],

        ['done_percent', '', '', self::MUST_VALIDATE, 'require', self::MODEL_INSERT],// 任务完成度
        ['done_percent', '', '', self::EXISTS_VALIDATE, 'integer'],

        ['next_user_id', '', '', self::MUST_VALIDATE, 'require', self::MODEL_INSERT],// 下任执行人
        ['next_user_id', '', '', self::EXISTS_VALIDATE, 'integer'],

    ];

    //自动完成
    protected $_auto = [
        ['created_by', 'fill_created_by', self::MODEL_INSERT, 'function'],
        ['created', 'time', self::MODEL_INSERT, 'function'],
    ];

}
